<?php  
def
$mem_start=memory_get_usage();
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime; 

$root = dirname(dirname(__FILE__));

if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}

set_include_path(
    $root . DS .'lib'. PATH_SEPARATOR
    . $root . DS .'application'. PATH_SEPARATOR
    . get_include_path()
);

try {
    require 'bootstrap.php';
} catch (Exception $exception) 
{
    echo '<html><body><center>An exception occured while bootstrapping the application.';
    if (defined('APPLICATION_ENVIRONMENT') && APPLICATION_ENVIRONMENT != 'production') {
        echo '<br /><br />' . $exception->getMessage() . '<br /><div align="left">Stack Trace:<pre>' . $exception->getTraceAsString() . '</pre></div>';
    }
    echo '</center></body></html>';
    exit(1);
}
Bootstrap::run();

if ($GLOBALS['_DBG']==1)
{
	$mtime = microtime();
	$mtime = explode(" ",$mtime);
	$mtime = $mtime[1] + $mtime[0];
	$endtime = $mtime;
	$totaltime = ($endtime - $starttime);
	$mem_end=memory_get_usage();
	echo '<div style="font-weight: bold">This page was created in ' . number_format($totaltime, 4) . ' seconds</div>'; 
	echo '<div>The memory allocated is ' . number_format($mem_start/1024/1024, 2) . '/' . number_format($mem_end/1024/1024, 2) . '</div>';
}